package com.starry.module.system.api.tenant.factory;

import com.starry.core.common.domain.R;
import com.starry.module.system.api.tenant.SysTenantApi;
import com.starry.module.system.api.tenant.domain.vo.SysTenantDtlVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 租户服务降级处理
 *
 * @author xiaoke
 */
@Slf4j
@Component
public class SysTenantApiFactory implements FallbackFactory<SysTenantApi> {
    @Override
    public SysTenantApi create(Throwable cause) {
        return new SysTenantApi() {

            @Override
            public R<SysTenantDtlVo> findById(Long id) {
                return R.fail();
            }
        };
    }
}
